from multiprocessing import Process
from time import sleep
import os

'''


'''
def task1(s):

    while True:
        print('---进程1----', os.getpid(), '------', os.getppid(),'----',s)
        sleep(1)

def task2(s):

    while True:
        print('---进程2----',os.getpid(),'------',os.getppid(),'----',s)
        sleep(1)


if __name__ == '__main__':
    p1=Process(target=task1,name='task1',args=(1,))
    p2=Process(target=task2,name='task2',args=(2,))

    p1.start()
    p2.start()